home *** CD-ROM | disk | FTP | other *** search
- Path: center.colgate.edu!JWILSON
- From: jwilson@center.colgate.edu (KRSNA CONSCIOUSNESS NOW)
- Newsgroups: comp.lang.c++
- Subject: maybe a FAQ... how to ensure the order in which global constructors are called?
- Date: 11 Jan 1996 17:17:38 GMT
- Organization: Colgate University
- Message-ID: <4d3gni$pmp@inet01.colgate.edu>
- Reply-To: jwilson@center.colgate.edu
- NNTP-Posting-Host: center.colgate.edu
-
-
- Hello, I've looked through the FAQ and couldn't find the answer to the
- eponymous question. My situation is this: I have a container class
- Registry which contains objects of type Handle. I subclassed Handle to
- RegisterHandle, and as part of the constructor of RegisterHandle, the new
- RegisterHandle is automatically added to a global Registry. Or I would
- so; this only works if the global registry has been constructed prior to
- the construction of the RegisterHandle.
-
- I realize I could probably get away with using a global Registry pointer
- and initializing it if it's NULL in the constructor to RegisterHandle;
- however, this seems ugly. Is there a mechanism for ensuring that global
- constructors are called in a certain order?
-
- Thanks.
-
- James Wilson
-